
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%> 

<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <link href="../assets/css/bootstrap.min.css" rel="stylesheet" />
        <link rel="stylesheet" href="../css/style.css"/>       
        <link href="../assets/css/codemirror.css" rel="stylesheet">
        <link rel="stylesheet" href="../assets/css/ace.min.css" />
        <link rel="stylesheet" href="../assets/css/font-awesome.min.css" />
          <script src="js/jquery-1.9.1.min.js"></script>
		<script type="text/javascript">
			window.jQuery || document.write("<script src='../assets/js/jquery-2.0.3.min.js'>"+"<"+"/script>");
		</script>
       <script type="text/javascript">
			if("ontouchend" in document) document.write("<script src='../assets/js/jquery.mobile.custom.min.js'>"+"<"+"/script>");
		</script>
		<script src="../assets/js/bootstrap.min.js"></script>
		<script src="../assets/js/typeahead-bs2.min.js"></script>
		<!-- page specific plugin scripts -->
		<script src="../assets/js/jquery.dataTables.min.js"></script>
		<script src="../assets/js/jquery.dataTables.bootstrap.js"></script>
        <script type="text/javascript" src="../js/H-ui.js"></script> 
        <script type="text/javascript" src="../js/H-ui.admin.js"></script> 
        <script src="../assets/layer/layer.js" type="text/javascript" ></script>
        <script src="../assets/laydate/laydate.js" type="text/javascript"></script>
		<script src="../js/jquery-1.9.1.min.js"></script>
<script type="text/javascript">
  function chaxun(){
  
 
     var bid=document.ff1.bid.value;
      var iid=document.ff1.iid.value;
  
   if(isNaN(bid))
   {
     alert("合同编号需为数字");       
   }else{
    if(isNaN(iid)){
    
     alert("订单编号需为数字");
    
    }else{
    
        ff1.submit();
    
    }
   }
  
  }



  	function shanchu() {

										var a = $("input[type='checkbox']:checked").length;

										
										if (a == 1) {

											obj = document
													.getElementsByName("ace");
											check_val = [];
											for (k in obj) {
												if (obj[k].checked)
													check_val
															.push(obj[k].value);
											}
											
											id=check_val;
							

										

											if (id == null || id == "") {
												alert("请选择编号");
											} else {

												var state = document
														.getElementById("st"
																+ id).innerText;
												if (state == '已还完') {
												layer.confirm('确认要作废吗？', function(index) {
					                           layer.msg('已作废!', {
						                        icon : 1,
						                        time : 1000
					                          });
					                  window.location.href = "../housepayment/delete.do?id="+id;
																				

				                       });
												

													

												

												} else {
												
															alert("当前状态不可作废");				
																	
												}
											}
										} else {
											alert("该操作只能选中一个");

										}

									}
									
									
	
	
	
	function shoukuan(){

										var a = $("input[type='checkbox']:checked").length;

										
										if (a == 1) {

											obj = document
													.getElementsByName("ace");
											check_val = [];
											for (k in obj) {
												if (obj[k].checked)
													check_val
															.push(obj[k].value);
											}
											
											id=check_val;
							

											

											if (id == null || id == "") {
												alert("请选择编号");
											} else {

												var state = document
														.getElementById("st"
																+ id).innerText;
												if (state == '已还完') {
												alert("该房款已还清");

										

												} else {
												
                                               
												 window.location.href = "../housepayment/update.do?id="+id;
										
																		
																	
												}
											}
										} else {
											alert("该操作只能选中一个");

										}

									}
									
									
									
  			function gengming(){
  				var a = $("input[type='checkbox']:checked").length;

										
										if (a == 1) {

											obj = document
													.getElementsByName("ace");
											check_val = [];
											for (k in obj) {
												if (obj[k].checked)
													check_val
															.push(obj[k].value);
											}
											
											id=check_val;
							

										

											if (id == null || id == "") {
												alert("请选择编号");
											} else {
                                             
                                              var cname = document
														.getElementById("cname"
																+ id).innerText;
											  var room = document
														.getElementById("r"
																+ id).innerText;
											
                                            
											 window.location.href = "../housepayment/gengming.do?id="+id+"&cname="+cname;
									
											
											
											}
										} else {
											alert("该操作只能选中一个");

										}
  			
  			
  			
  			
  			
  			
  			
  			}					
  
  
  
  function huanfang(){
  				var a = $("input[type='checkbox']:checked").length;

										
										if (a == 1) {

											obj = document
													.getElementsByName("ace");
											check_val = [];
											for (k in obj) {
												if (obj[k].checked)
													check_val
															.push(obj[k].value);
											}
											
											id=check_val;
							

									

											if (id == null || id == "") {
												alert("请选择编号");
											} else {
                                             
                                             
                                             var room = document
														.getElementById("r"
																+ id).innerText;
											
                                             room=room.replace(/\#/g,"%23"); 
                                             
											 window.location.href = "../housepayment/huanfang.do?id="+id+"&nn="+room;
									
											
											
											}
										} else {
											alert("该操作只能选中一个");

										}
  			
  			
  			
  			
  			
  			
  			
  			}					
  
  
  
  
  	function daochu() {

										var a = $("input[type='checkbox']:checked").length;

									if(a>=1){

											obj = document
													.getElementsByName("ace");
											check_val = [];
											for (k in obj) {
												if (obj[k].checked)
													check_val
															.push(obj[k].value);
										    }
										 	alert(check_val);
											
											
                                             
								 window.location.href = "../housepayment/daochu.do?b="+check_val;
											
										

				}else{
				  alert("请选择要导出的信息");
				  
				  
				
				}
				
				
				
				}		
									
  
  
  

</script>






<title>房款列表</title>
</head>

<body>
<div class="page-content clearfix">
    <div id="Member_Ratings">
      <div class="d_Confirm_Order_style">
    <div class="search_style">
      <ul class="search_content clearfix">
      <form action="select.do" method="post" name="ff1"> 
       <li> <label class="l_f">合同编号：</label>
      <input type="text" name="bid"></input></li>
       <li> <label class="l_f">订单编号：</label>
      <input type="text" name="iid"></input>
       <li style="width:90px;"><button type="button" onclick="chaxun()" class="btn_search">查询</button></li>
     </form>
      </ul>
      
      
      
    </div>
     <div class="border clearfix">
       <span class="l_f">
        <!-- <a href="../marketing/add.do" class="btn btn-xs btn-info"><i class="fa fa-check  bigger-120">添加</i></a> -->
        <a title="删除" onclick="shanchu()" class="btn btn-warning">作废</a>    
         <a title="编辑 " onclick="daochu()" class="btn btn-xs btn-success"><i class="fa fa-check  bigger-120">导出</i></a>
       </span>
       <span style="margin-left:23.5cm;">
       
       <a onclick="shoukuan()" class="btn btn-xs btn-info"><i class="fa fa-check  bigger-120">收款</i></a>
       <a onclick="gengming()"  class="btn btn-warning">更名申请</a>
       <a onclick="huanfang()" class="btn btn-xs btn-success"><i class="fa fa-check  bigger-120">换房</i></a>  
        </span>  
     </div>
    <form name="ff">
     <div class="table_menu_list">
       <table class="table table-striped table-bordered table-hover" id="sample-table">
		<thead>
		 <tr>
				<th width="25"><label><input type="checkbox" class="ace" name="ace" value=""><span class="lbl"></span></label></th>
				<th width="80">编号</th>
				<th width="80">合同编号</th>
				<th width="80">订单编号</th>
				<th width="100">房间编号</th>
				<th width="80">客户姓名</th>
				<th width="80">落户姓名</th>
				<th width="80">业务员编号</th>
				<th width="80">业务员名称</th>
				<th width="100">应收金额</th>
				<th width="100">已收金额</th>
				<th width="100">未收金额</th> 
				<th width="200">付款时间</th>
				<th width="50">付款类型</th>
				<!-- <th width="50">付款次数</th> -->
				<th width="50">状态</th>
				            
			<!-- 	<th width="300">操作</th> -->
			</tr>
		</thead>
	<tbody>

		
		<c:forEach items="${list}" var="l">
		<tr id="t${l.id}">
          <td><label><input type="checkbox" class="ace"  name="ace" value="${l.id}"><span class="lbl"></span></label></td>
          <td>${l.id}</td>
          <td>${l.bargainid}</td>
          <td>${l.indentid}</td>
          <td id="r${l.id}">${l.complex}#${l.unit}#${l.roomname}</td>
           <td id="cname${l.id}">${l.cname}</td>
            <td>${l.fname}</td>
            <td>${l.userid}</td>
             <td>${l.uname}</td>
              <td>${l.receivablemoney}</td>
              <td>${l.accomplishmoney}</td>
              <td>${l.uncollectedmoney}</td>
              <td><fmt:formatDate value="${l.collectiontime}" pattern='yyyy-MM-dd'/></td>
              <td>${l.paymenttype}</td>
             <!--  <td></td> -->
           <td id="st${l.id}">${l.state}</td>
      
         
		</tr> 
		
		</c:forEach>
		
		
		
      </tbody>
	</table>
	</form>
   </div>
  </div>
 </div>
</div>
</body>


</html>




